package com.bestcem.xm.member.grpc.service.param.syncrule;

import com.bestcem.xm.common.core.constant.RegTypes;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @author ming.xue <ming.xue@idiaoyan.com>
 * @desc 更新同步规则参数
 * @date 2021-08-15
 */
@Getter
@Setter
@NoArgsConstructor
public class UpdateSyncRuleParam {
    /**
     * 同步规则标识
     */
    @NotBlank(message = "同步规则标识不能为空")
    @Pattern(regexp = RegTypes.OBJECT_ID, message = "同步规则标识格式错误")
    private String id;

    /**
     * 同步类型
     */
    @NotNull(message = "答卷同步类型不能为空")
    private Integer syncType;

    /**
     * 同步类型
     */
    @NotNull(message = "微信同步类型不能为空")
    private Integer wechatSyncType;

    /**
     * 匹配字段列表
     */
    @Size(max = 2, message = "匹配字段数量过多,最多2项")
    private List<String> queryFields;

    /**
     * 更新字段列表
     */
    private List<String> updateFields;
}
